package com.xmh.factorydemo.controller;

import com.xmh.factorydemo.factory.StrategyFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Controller
@RestController
@RequestMapping("/userPayController")
@CrossOrigin
public class UserPayController {

    @RequestMapping(value = "/selectList")
    public Map<String, Object> selectList(String amnout) {
        Map<String, Object> map = new HashMap<String, Object>();

        map.put("data", StrategyFactory.getUserService().quote(new BigDecimal(amnout)));

        return map;
    }

}
